package com.example.book.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * (Book)表实体类
 *
 * @author makejava
 * @since 2022-12-02 16:18:34
 */
@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Book extends Model<Book> {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String bookName;

    private String author;

    private String version;

    private String publisher;

    private Double price;
    //库存
    private Integer count;
    //图书种类
    private String bookType;

    private String bookImage;

    private Integer rate;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}

